package com.sky.mapper;

import com.github.pagehelper.Page;

import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {

    /**
     * 根据分类id查询菜品数量
     * @param categoryId
     * @return
     */
    @Select("select count(id) from dish where category_id = #{categoryId}")
    Integer countByCategoryId(Long categoryId);

    void insertBydish(Dish dish);

    Page<Dish> selectByPage(DishPageQueryDTO dishPageQueryDTO);

    void delectByid(Integer id);

    Dish selectByidStatus(Integer id);

    void putstatus(Integer status, Integer id);

    Dish selectByid(Integer id);

    void putByList(Dish dish);

    List<Dish> selectByCategoryId(Dish dish);
}
